<!doctype html>



  


<html class="theme-next muse use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.1" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="Squid," />








  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.1" />






<meta name="description" content="&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;squid常用命令： 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475">
<meta name="keywords" content="Squid">
<meta property="og:type" content="article">
<meta property="og:title" content="Squid.conf配置文件详解">
<meta property="og:url" content="https://hcldirgit.github.io/2017/09/03/Squid/5. Squid.conf配置文件详解/index.html">
<meta property="og:site_name" content="失落的乐章">
<meta property="og:description" content="&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;squid常用命令： 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475">
<meta property="og:locale" content="zh-Hans">
<meta property="og:updated_time" content="2017-09-02T17:35:28.329Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Squid.conf配置文件详解">
<meta name="twitter:description" content="&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;squid常用命令： 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Muse',
    sidebar: {"position":"left","display":"post","offset":12,"offset_float":0,"b2t":false,"scrollpercent":false},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://hcldirgit.github.io/2017/09/03/Squid/5. Squid.conf配置文件详解/"/>





  <title>Squid.conf配置文件详解 | 失落的乐章</title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  




<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
  ga('create', '85*****1', 'auto');
  ga('send', 'pageview');
</script>


  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?87980c**************99ec5e26fb5";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>











  
  
    
  

  <div class="container sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">失落的乐章</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">技术面前，永远都是学生。</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-message">
          <a href="/message" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-external-link"></i> <br />
            
            留言
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
    <link itemprop="mainEntityOfPage" href="https://hcldirgit.github.io/2017/09/03/Squid/5. Squid.conf配置文件详解/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="失落的乐章">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/0.png">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="失落的乐章">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">Squid.conf配置文件详解</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-09-03T02:13:44+08:00">
                2017-09-03
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;squid常用命令：</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div><div class="line">36</div><div class="line">37</div><div class="line">38</div><div class="line">39</div><div class="line">40</div><div class="line">41</div><div class="line">42</div><div class="line">43</div><div class="line">44</div><div class="line">45</div><div class="line">46</div><div class="line">47</div><div class="line">48</div><div class="line">49</div><div class="line">50</div><div class="line">51</div><div class="line">52</div><div class="line">53</div><div class="line">54</div><div class="line">55</div><div class="line">56</div><div class="line">57</div><div class="line">58</div><div class="line">59</div><div class="line">60</div><div class="line">61</div><div class="line">62</div><div class="line">63</div><div class="line">64</div><div class="line">65</div><div class="line">66</div><div class="line">67</div><div class="line">68</div><div class="line">69</div><div class="line">70</div><div class="line">71</div><div class="line">72</div><div class="line">73</div><div class="line">74</div><div class="line">75</div><div class="line">76</div><div class="line">77</div><div class="line">78</div><div class="line">79</div><div class="line">80</div><div class="line">81</div><div class="line">82</div><div class="line">83</div><div class="line">84</div><div class="line">85</div><div class="line">86</div><div class="line">87</div><div class="line">88</div><div class="line">89</div><div class="line">90</div><div class="line">91</div><div class="line">92</div><div class="line">93</div><div class="line">94</div><div class="line">95</div><div class="line">96</div><div class="line">97</div><div class="line">98</div><div class="line">99</div><div class="line">100</div><div class="line">101</div><div class="line">102</div><div class="line">103</div><div class="line">104</div><div class="line">105</div><div class="line">106</div><div class="line">107</div><div class="line">108</div><div class="line">109</div><div class="line">110</div><div class="line">111</div><div class="line">112</div><div class="line">113</div><div class="line">114</div><div class="line">115</div><div class="line">116</div><div class="line">117</div><div class="line">118</div><div class="line">119</div><div class="line">120</div><div class="line">121</div><div class="line">122</div><div class="line">123</div><div class="line">124</div><div class="line">125</div><div class="line">126</div><div class="line">127</div><div class="line">128</div><div class="line">129</div><div class="line">130</div><div class="line">131</div><div class="line">132</div><div class="line">133</div><div class="line">134</div><div class="line">135</div><div class="line">136</div><div class="line">137</div><div class="line">138</div><div class="line">139</div><div class="line">140</div><div class="line">141</div><div class="line">142</div><div class="line">143</div><div class="line">144</div><div class="line">145</div><div class="line">146</div><div class="line">147</div><div class="line">148</div><div class="line">149</div><div class="line">150</div><div class="line">151</div><div class="line">152</div><div class="line">153</div><div class="line">154</div><div class="line">155</div><div class="line">156</div><div class="line">157</div><div class="line">158</div><div class="line">159</div><div class="line">160</div><div class="line">161</div><div class="line">162</div><div class="line">163</div><div class="line">164</div><div class="line">165</div><div class="line">166</div><div class="line">167</div><div class="line">168</div><div class="line">169</div><div class="line">170</div><div class="line">171</div><div class="line">172</div><div class="line">173</div><div class="line">174</div><div class="line">175</div><div class="line">176</div><div class="line">177</div><div class="line">178</div><div class="line">179</div><div class="line">180</div><div class="line">181</div><div class="line">182</div><div class="line">183</div><div class="line">184</div><div class="line">185</div><div class="line">186</div><div class="line">187</div></pre></td><td class="code"><pre><div class="line">/usr/<span class="built_in">local</span>/squid/sbin/squid -z 初始化缓存空间</div><div class="line">/usr/<span class="built_in">local</span>/squid/sbin/squid 启动</div><div class="line">/usr/<span class="built_in">local</span>/squid/sbin/squid -k shutdown 停止</div><div class="line">/usr/<span class="built_in">local</span>/squid/sbin/squid -k reconfigure 重新载入配置文件</div><div class="line">/usr/<span class="built_in">local</span>/squid/sbin/squid -k rotate 轮循日志</div><div class="line"></div><div class="line"><span class="comment">#acl all src 0.0.0.0/0.0.0.0 and http_access allow all选项定义了一个访问控制列表。详细情况参见和Squid软件</span></div><div class="line"><span class="comment">#携带的文档。这里的访问控制列表允许所有对代理服务的访问，因为这里该代理是加速web服务器。</span></div><div class="line">acl all src 0.0.0.0/0.0.0.0                 <span class="comment">#允许所有IP访问</span></div><div class="line">acl manager proto http                 <span class="comment">#manager url协议为http</span></div><div class="line">acl localhost src 127.0.0.1/255.255.255.255  <span class="comment">#允午本机IP</span></div><div class="line">acl to_localhost dst 127.0.0.1                 <span class="comment">#允午目的地址为本机IP</span></div><div class="line">acl Safe_ports port 80                <span class="comment"># 允许安全更新的端口为80</span></div><div class="line">acl CONNECT method CONNECT        <span class="comment">#请求方法以CONNECT</span></div><div class="line">http_access allow all                <span class="comment">#允许所有人使用该代理.因为这里是代理加速web服务器</span></div><div class="line">http_reply_access allow all                <span class="comment">#允许所有客户端使用该代理</span></div><div class="line"></div><div class="line">acl OverConnLimit maxconn 16        <span class="comment">#限制每个IP最大允许16个连接，防止攻击</span></div><div class="line">http_access deny OverConnLimit</div><div class="line"></div><div class="line">icp_access deny all                        <span class="comment">#禁止从邻居服务器缓冲内发送和接收ICP请求.</span></div><div class="line">miss_access allow all                <span class="comment">#允许直接更新请求</span></div><div class="line">ident_lookup_access deny all                                <span class="comment">#禁止lookup检查DNS</span></div><div class="line">http_port 8080 transparent                                <span class="comment">#指定Squid监听浏览器客户请求的端口号。</span></div><div class="line"></div><div class="line">hierarchy_stoplist cgi-bin ?                <span class="comment">#用来强制某些特定的对象不被缓存，主要是处于安全的目的。</span></div><div class="line">acl QUERY urlpath_regex cgi-bin ?</div><div class="line">cache deny QUERY</div><div class="line"></div><div class="line">cache_mem 1 GB        <span class="comment">#这是一个优化选项，增加该内存值有利于缓存。应该注意的是：</span></div><div class="line">                     <span class="comment">#一般来说如果系统有内存，设置该值为(n/)3M。现在是3G 所以这里1G</span></div><div class="line">fqdncache_size 1024        <span class="comment">#FQDN 高速缓存大小</span></div><div class="line">maximum_object_size_in_memory 2 MB        <span class="comment">#允许最大的文件载入内存</span></div><div class="line"></div><div class="line">memory_replacement_policy heap LFUDA  <span class="comment">#动态使用最小的，移出内存cache</span></div><div class="line">cache_replacement_policy heap LFUDA         <span class="comment">#动态使用最小的，移出硬盘cache</span></div><div class="line"></div><div class="line">cache_dir ufs /home/cache 5000 32 512  <span class="comment">#高速缓存目录 ufs 类型 使用的缓冲值最大允午1000MB空间，</span></div><div class="line"><span class="comment">#32个一级目录，512个二级目录</span></div><div class="line"></div><div class="line">max_open_disk_fds 0                                 <span class="comment">#允许最大打开文件数量,0 无限制</span></div><div class="line">minimum_object_size 1 KB                         <span class="comment">#允午最小文件请求体大小</span></div><div class="line">maximum_object_size 20 MB                 <span class="comment">#允午最大文件请求体大小</span></div><div class="line"></div><div class="line">cache_swap_low 90                            <span class="comment">#最小允许使用swap 90%</span></div><div class="line">cache_swap_high 95                            <span class="comment">#最多允许使用swap 95%</span></div><div class="line"></div><div class="line">ipcache_size 2048                                <span class="comment"># IP 地址高速缓存大小 2M</span></div><div class="line">ipcache_low 90                                <span class="comment">#最小允许ipcache使用swap 90%</span></div><div class="line">ipcache_high 95                                  <span class="comment">#最大允许ipcache使用swap 90%</span></div><div class="line"></div><div class="line"></div><div class="line">access_log /var/<span class="built_in">log</span>/squid/access.log squid        <span class="comment">#定义日志存放记录</span></div><div class="line">cache_log /var/<span class="built_in">log</span>/squid/cache.log squid</div><div class="line">cache_store_log none                        <span class="comment">#禁止store日志</span></div><div class="line"></div><div class="line">emulate_httpd_log on        <span class="comment">#将使Squid仿照Web服务器的格式创建访问记录。如果希望使用</span></div><div class="line">                                <span class="comment">#Web访问记录分析程序，就需要设置这个参数。</span></div><div class="line"></div><div class="line">refresh_pattern . 0 20% 4320 override-expire override-lastmod reload-into-ims ignore-reload   <span class="comment">#更新cache规则</span></div><div class="line"></div><div class="line">acl buggy_server url_regex ^http://.... http://          <span class="comment">#只允许http的请求</span></div><div class="line">broken_posts allow buggy_server</div><div class="line"></div><div class="line">acl apache rep_header Server ^Apache                 <span class="comment">#允许apache的编码</span></div><div class="line">broken_vary_encoding allow apache</div><div class="line"></div><div class="line">request_entities off                                        <span class="comment">#禁止非http的标分准请求，防止攻击</span></div><div class="line">header_access header allow all                        <span class="comment">#允许所有的http报头</span></div><div class="line">relaxed_header_parser on                                <span class="comment">#不严格分析http报头.</span></div><div class="line">client_lifetime 120 minute                                <span class="comment">#最大客户连接时间 120分钟</span></div><div class="line"></div><div class="line">cache_mgr sky@test.com                        <span class="comment">#指定当缓冲出现问题时向缓冲管理者发送告警信息的地址信息。</span></div><div class="line"></div><div class="line">cache_effective_user squid                        <span class="comment">#这里以用户squid的身份Squid服务器</span></div><div class="line">cache_effective_group squid</div><div class="line"></div><div class="line">icp_port 0                       <span class="comment">#指定Squid从邻居服务器缓冲内发送和接收ICP请求的端口号。</span></div><div class="line">                     <span class="comment">#这里设置为0是因为这里配置Squid为内部Web服务器的加速器，</span></div><div class="line">                     <span class="comment">#所以不需要使用邻居服务器的缓冲。0是禁用</span></div><div class="line"></div><div class="line"><span class="comment"># cache_peer 设置允许更新缓存的主机，因是本机所以127.0.0.1</span></div><div class="line">cache_peer 127.0.0.1 parent 80 0 no-query default multicast-responder no-netdb-exchange</div><div class="line">cache_peer_domain 127.0.0.1                                 </div><div class="line">hostname_aliases 127.0.0.1</div><div class="line"></div><div class="line">error_directory /usr/share/squid/errors/Simplify_Chinese        <span class="comment">#定义错误路径</span></div><div class="line"></div><div class="line">always_direct allow all                <span class="comment"># cache丢失或不存在是允许所有请求直接转发到原始服务器</span></div><div class="line">ignore_unknown_nameservers on        <span class="comment">#开反DNS查询，当域名地址不相同时候，禁止访问</span></div><div class="line">coredump_dir  /var/<span class="built_in">log</span>/squid                 <span class="comment">#定义dump的目录</span></div><div class="line"></div><div class="line">max_filedesc 2048                <span class="comment">#最大打开的文件描述</span></div><div class="line"></div><div class="line">half_closed_clients off        <span class="comment">#使Squid在当read不再返回数据时立即关闭客户端的连接。</span></div><div class="line">                                <span class="comment">#有时read不再返回数据是由于某些客户关闭TCP的发送数据</span></div><div class="line">                                <span class="comment">#而仍然保持接收数据。而Squid分辨不出TCP半关闭和完全关闭。</span></div><div class="line"></div><div class="line">buffered_logs on <span class="comment">#若打开选项“buffered_logs”可以稍稍提高加速某些对日志文件的写入，该选项主要是实现优化特性。</span></div><div class="line"></div><div class="line"><span class="comment">#防止天涯盗链，转嫁给百度</span></div><div class="line">acl tianya referer_regex -i tianya</div><div class="line">http_access deny tianya</div><div class="line">deny_info  tianya</div><div class="line"><span class="comment">#阻止baidu蜘蛛</span></div><div class="line">acl baidu req_header User-Agent Baiduspider</div><div class="line">http_access deny baidu</div><div class="line"><span class="comment">#限制同一IP客户端的最大连接数</span></div><div class="line">acl OverConnLimit maxconn 128</div><div class="line">http_access deny OverConnLimit</div><div class="line"></div><div class="line"><span class="comment">#防止被人利用为HTTP代理，设置允许访问的IP地址</span></div><div class="line">acl myip dst 222.18.63.37</div><div class="line">http_access deny !myip</div><div class="line"></div><div class="line"><span class="comment">#允许本地管理</span></div><div class="line">acl Manager proto cache_object</div><div class="line">acl Localhost src 127.0.0.1 222.18.63.37</div><div class="line">http_access allow Manager Localhost</div><div class="line">cachemgr_passwd 53034338 all</div><div class="line">http_access deny Manager</div><div class="line"></div><div class="line"><span class="comment">#仅仅允许80端口的代理</span></div><div class="line">acl all src 0.0.0.0/0.0.0.0</div><div class="line">acl Safe_ports port 80 <span class="comment"># http</span></div><div class="line">http_access deny !Safe_ports</div><div class="line">http_access allow all</div><div class="line"></div><div class="line"><span class="comment">#Squid信息设置</span></div><div class="line">visible_hostname happy.swjtu.edu.cn</div><div class="line">cache_mgr  ooopic2008@qq.com</div><div class="line"></div><div class="line"><span class="comment">#基本设置</span></div><div class="line">cache_effective_user squid</div><div class="line">cache_effective_group squid</div><div class="line">tcp_recv_bufsize 65535 bytes</div><div class="line"></div><div class="line"><span class="comment">#2.6的反向代理加速配置</span></div><div class="line">cache_peer 127.0.0.1 parent 80 0 no-query originserver</div><div class="line"></div><div class="line"><span class="comment">#错误文档</span></div><div class="line">error_directory /usr/<span class="built_in">local</span>/squid/share/errors/Simplify_Chinese</div><div class="line"></div><div class="line"><span class="comment">#单台使用，不使用该功能</span></div><div class="line">icp_port 0</div><div class="line"></div><div class="line">hierarchy_stoplist cgi-bin ?</div><div class="line"></div><div class="line">acl QUERY urlpath_regex cgi-bin ? .php .cgi .avi .wmv .rm .ram .mpg .mpeg .zip .exe</div><div class="line">cache deny QUERY</div><div class="line"></div><div class="line">acl apache rep_header Server ^Apache</div><div class="line">broken_vary_encoding allow apache</div><div class="line"></div><div class="line"></div><div class="line">refresh_pattern ^ftp:           1440 20%     10080</div><div class="line">refresh_pattern ^gopher:        1440 0%    1440</div><div class="line">refresh_pattern .             0    20%     4320</div><div class="line"></div><div class="line">cache_store_log none</div><div class="line">pid_filename /usr/<span class="built_in">local</span>/squid/var/logs/squid.pid</div><div class="line">emulate_httpd_log on</div><div class="line">logformat combined %&gt;a %ui %un [%tl] <span class="string">"%rm %ru HTTP/%rv"</span> %Hs %&lt;st <span class="string">"%&#123;Referer&#125;&gt;h"</span> <span class="string">"%&#123;User-Agent&#125;&gt;h"</span> %Ss:%Sh</div><div class="line">cache_log /usr/<span class="built_in">local</span>/squid/var/logs/cache.log</div><div class="line">access_log /usr/<span class="built_in">local</span>/squid/var/logs/access.log combined</div><div class="line">coredump_dir /usr/<span class="built_in">local</span>/squid/var/cache</div><div class="line">cache_dir ufs /usr/<span class="built_in">local</span>/squid/var/cache 10000 16 256</div><div class="line"></div><div class="line">dns_children 32</div><div class="line">hosts_file /etc/hosts</div><div class="line"></div><div class="line">cache_mem 400 MB</div><div class="line">cache_swap_low 90</div><div class="line">cache_swap_high 95</div><div class="line">maximum_object_size 32768 KB</div><div class="line">maximum_object_size_in_memory 4096 KB</div><div class="line">emulate_httpd_log on</div><div class="line"></div><div class="line"></div><div class="line"><span class="comment">#防止盗链</span></div><div class="line">acl picurl url_regex -i .bmp$ .png$ .jpg$ .gif$ .jpeg$</div><div class="line">acl mystie1 referer_regex -i happy.swjtu.edu.cn</div><div class="line">http_access allow mystie1 picurl</div><div class="line">acl nullref referer_regex -i ^$</div><div class="line">http_access allow nullref</div><div class="line">acl hasref referer_regex -i .+</div><div class="line">http_access deny hasref picurl</div></pre></td></tr></table></figure>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/Squid/" rel="tag"># Squid</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2017/09/03/Squid/4. Linux下squid.conf中cache_peer参数详解/" rel="next" title="Linux下squid.conf中cache_peer参数详解">
                <i class="fa fa-chevron-left"></i> Linux下squid.conf中cache_peer参数详解
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2017/09/03/Squid/6. Squid优化/" rel="prev" title="Squid优化">
                Squid优化 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      

      <section class="site-overview sidebar-panel sidebar-panel-active">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/0.png"
               alt="失落的乐章" />
          <p class="site-author-name" itemprop="name">失落的乐章</p>
           
              <p class="site-description motion-element" itemprop="description">失落的乐章的Blog</p>
          
        </div>
        <nav class="site-state motion-element">

          
            <div class="site-state-item site-state-posts">
              <a href="/">
                <span class="site-state-item-count">627</span>
                <span class="site-state-item-name">日志</span>
              </a>
            </div>
          

          

          
            
            
            <div class="site-state-item site-state-tags">
              <a href="/tags/index.html">
                <span class="site-state-item-count">38</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/hcldirgit" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
          
        </div>

        
        

        
        

        


      </section>

      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2017</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">失落的乐章</span>
</div>


<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Muse
  </a>
</div>


        

        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.1"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.1"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.1"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.1"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.1"></script>



  


  




	





  





  





  






  





  

  

  

  

  

  

</body>
</html>
